Skip to main content

测量协议


该文章记录了 GrowingIO SDK 上传时所有的字段及其参数意义。

所有事件携带的信息(context)

字段名称数据类型是否必有解释说明
platformstring操作平台
1. Android;
2. iOS
3. Web
platformVersionstring操作系统版本
deviceIdstring设备ID(访问用户ID)
userIdstring登录用户ID
sessionIdstring访问会话ID
eventTypestring事件类型:VISIT
CUSTOM
VISITOR_ATTRIBUTES
LOGIN_USER_ATTRIBUTES
CONVERSION_VARIABLES
APP_CLOSED
PAGE
PAGE_ATTRIBUTES
VIEW_CLICK
VIEW_CHANGE
FORM_SUBMIT
ACTIVATE
timestamplong时间戳
domainstringAPP包名或者H5页面的域名
urlSchemestring链接协议
appStatestringAPP状态:1. FOREGROUND 前台运行
2. BACKGROUND 后台运行
globalSequenceIdlong全局请求编号
eventSequenceIdlong事件请求编号
dataSourceIdstringCDP特有,只有在cdp上面才是必须字段
gioIdstringCDP特有,idMapping使用
networkStatestring网络类型:2G,3G,4G,5G,WIFI,UNKNOWN
appChannelstring应用渠道(Android 特有)
screenHeightint屏幕高度
screenWidthint屏幕宽度
deviceBrandstring设备品牌
deviceModelstring设备型号
deviceTypestring设备类型:PHONE,PAD,…
appVersionstringAPP版本,用户配置
appNamestringAPP名称
languagestring语言, ISO 639标准
Android:ISO 639 alpha-2 or alpha-3
iOS:ISO 639-1 code if available, or the ISO 639-2 code if not
> ISO 639 不是一个稳定的标准
latitudedouble纬度
longitudedouble经度
sdkVersionstringSDK 版本号
userKeystring登录用户ID的类型(用户自定义)
operatingSystemstring小程序必有,系统类型

访问事件(VISIT)

  • 请求发送时机:每当产生一个新的访问时
  • 请求Body
字段名称数据类型是否必有解释说明
imeistringIMEI(Android 特有)
androidIdstringAndroidId(Android 特有)
oaidstring国内的广告ID(Android 特有)
googleAdvertisingIdstringgoogle广告ID(Android 特有)
idfastringiOS广告标识符(iOS 特有)
idfvstringiOS应用开发商标识符(iOS 特有)
extraSdkMap<string, string>额外的SDK信息

示例

{
"deviceId": "7196f014-d7bc-4bd8-b920-757cb2375ff6",
"userId": "张三",
"sessionId": "d5cbcf77-b38b-4223-954f-c6a2fdc0c098",
"eventType": "VISIT",
"timestamp": 1506069592985,
"domain": "com.growingio.app",
"urlScheme": "growing.756c39fb86f318cc",
"appState": "FOREGROUND",
"globalSequenceId": 99,
"eventSequenceId": 3,
"networkState": "4G",
"appChannel": "应用宝",
"screenHeight": 1920,
"screenWidth": 1080,
"deviceBrand": "google",
"deviceModel": "Nexus 5",
"deviceType": "PHONE",
"platform": "Android",
"platformVersion": "7.1.2",
"appName": "看数小助手",
"appVersion": "1.2.4",
"language": "zh_CN",
"latitude": 39.988518,
"longitude": 116.478797,
"oaid": "eeefbf75-3df7-15e0-ffb5-ff1ff09f1ec3",
"sdkVersion": "3.3.6",
"extraSdk": {
"GrowingTouch": "1.2.3"
}
}

埋点事件(CUSTOM)

  • 请求发送时机:当用户主动调用track类型的接口时,半自动埋点,自主业务采集
  • 请求Body
字段名称数据类型是否必有解释说明
eventNamestring埋点事件的标识符
pathstring埋点事件关联的page
pageShowTimestamplong埋点事件关联的page的显示时间戳
attributesMap<string, string>埋点事件属性
querystringHybrid页面url 中的query
resourceItem对象 ResourceItem物品模型(CDP 特有)

ResourceItem

字段名称数据类型是否必有解释说明
idstring物品模型id
keystring物品模型key
attributesMap<string, string>物品模型属性

示例

{
"deviceId": "7196f014-d7bc-4bd8-b920-757cb2375ff6",
"userId": "张三",
"sessionId": "d5cbcf77-b38b-4223-954f-c6a2fdc0c098",
"eventType": "CUSTOM",
"timestamp": 1506069592985,
"domain": "com.growingio.app",
"urlScheme": "growing.756c39fb86f318cc",
"appState": "FOREGROUND",
"globalSequenceId": 99,
"eventSequenceId": 3,
"eventName": "pay",
"networkState": "4G",
"appChannel": "应用宝",
"screenHeight": 1920,
"screenWidth": 1080,
"deviceBrand": "google",
"deviceModel": "Nexus 5",
"deviceType": "PHONE",
"platform": "Android",
"platformVersion": "7.1.2",
"appName": "看数小助手",
"appVersion": "1.2.4",
"language": "zh_CN",
"latitude": 39.988518,
"longitude": 116.478797,
"sdkVersion": "3.3.6",
"attributes": {
"goods": "shoe",
"brand": "Nick"
}
"resourceItem": {
"key": "itemKey",
"id": "itemId"
}
}

用户属性事件(LOGIN_USER_ATTRIBUTES)

  • 请求发送时机:当用户主动调用track类型的接口时
  • 请求Body
字段名称数据类型是否必有解释说明
attributesMap<string, string>登录用户属性

示例

{
"deviceId": "7196f014-d7bc-4bd8-b920-757cb2375ff6",
"userId": "张三",
"sessionId": "d5cbcf77-b38b-4223-954f-c6a2fdc0c098",
"eventType": "LOGIN_USER_ATTRIBUTES",
"timestamp": 1506069592985,
"domain": "com.growingio.app",
"urlScheme": "growing.756c39fb86f318cc",
"appState": "FOREGROUND",
"globalSequenceId": 99,
"eventSequenceId": 3,
"networkState": "4G",
"appChannel": "应用宝",
"screenHeight": 1920,
"screenWidth": 1080,
"deviceBrand": "google",
"deviceModel": "Nexus 5",
"deviceType": "PHONE",
"platform": "Android",
"platformVersion": "7.1.2",
"appName": "看数小助手",
"appVersion": "1.2.4",
"language": "zh_CN",
"sdkVersion": "3.3.6",
"attributes": {
"vipLevel": "10",
"email": "xxx@growingio.com"
}
}

APP、小程序关闭事件(APP_CLOSED)

  • 请求发送时机:当用户关闭APP时,立刻发送

  • 请求Body

字段名称数据类型是否必有解释说明

示例

{
"deviceId": "7196f014-d7bc-4bd8-b920-757cb2375ff6",
"userId": "张三",
"sessionId": "d5cbcf77-b38b-4223-954f-c6a2fdc0c098",
"eventType": "APP_CLOSED",
"timestamp": 1506069592985,
"domain": "com.growingio.app",
"urlScheme": "growing.756c39fb86f318cc",
"appState": "FOREGROUND",
"globalSequenceId": 99,
"eventSequenceId": 3,
"networkState": "4G",
"appChannel": "应用宝",
"screenHeight": 1920,
"screenWidth": 1080,
"deviceBrand": "google",
"deviceModel": "Nexus 5",
"deviceType": "PHONE",
"platform": "Android",
"platformVersion": "7.1.2",
"appName": "看数小助手",
"appVersion": "1.2.4",
"language": "zh_CN",
"latitude": 39.988518,
"longitude": 116.478797,
"sdkVersion": "3.3.6",
}

页面浏览事件(PAGE)

  • 请求发送时机:当用户打开一个页面时
  • 请求Body
字段名称数据类型是否必有解释说明
pathstring页面名
orientationstring屏幕显示方向:
PORTRAIT 竖向
LANDSCAPE 横向
titlestring页面标题
referralPagestring来源页面
querystringHybrid页面url 中的query
protocolTypestringHybrid页面url 中的协议头,如https

示例

{
"deviceId": "7196f014-d7bc-4bd8-b920-757cb2375ff6",
"userId": "张三",
"sessionId": "d5cbcf77-b38b-4223-954f-c6a2fdc0c098",
"eventType": "PAGE",
"timestamp": 1506069592985,
"domain": "com.growingio.app",
"urlScheme": "growing.756c39fb86f318cc",
"appState": "FOREGROUND",
"globalSequenceId": 99,
"eventSequenceId": 3,
"path": "/NestedFragmentActivity/GreenFragment[fragment1]",
"orientation": "PORTRAIT",
"title": "GreenFragment",
"networkState": "4G",
"appChannel": "应用宝",
"screenHeight": 1920,
"screenWidth": 1080,
"deviceBrand": "google",
"deviceModel": "Nexus 5",
"deviceType": "PHONE",
"platform": "Android",
"platformVersion": "7.1.2",
"appName": "看数小助手",
"appVersion": "1.2.4",
"language": "zh_CN",
"latitude": 39.988518,
"longitude": 116.478797,
"sdkVersion": "3.3.6",
}

元素点击事件(VIEW_CLICK)

  • 请求发送时机:当用户点击页面元素的时候
  • 请求Body
字段名称数据类型是否必有解释说明
pathstring元素所属页面名
pageShowTimestamplong页面显示时间
textValuestring元素文本内容
xpathstringxpath标识符
indexint列表元素序号
hyperlinkstringHybrid页面元素的href
querystringHybrid页面url 中的query

示例

{
"deviceId": "7196f014-d7bc-4bd8-b920-757cb2375ff6",
"userId": "张三",
"sessionId": "d5cbcf77-b38b-4223-954f-c6a2fdc0c098",
"eventType": "VIEW_CLICK",
"timestamp": 1506069592985,
"domain": "com.growingio.app",
"urlScheme": "growing.756c39fb86f318cc",
"appState": "FOREGROUND",
"globalSequenceId": 99,
"eventSequenceId": 3,
"path": "/NestedFragmentActivity/GreenFragment[fragment1]",
"pageShowTimestamp": 1506069592985,
"textValue": "登录",
"xpath": "/Page/LinearLayout[0]/FrameLayout[1]/Button#login",
"networkState": "4G",
"appChannel": "应用宝",
"screenHeight": 1920,
"screenWidth": 1080,
"deviceBrand": "google",
"deviceModel": "Nexus 5",
"deviceType": "PHONE",
"platform": "Android",
"platformVersion": "7.1.2",
"appName": "看数小助手",
"appVersion": "1.2.4",
"language": "zh_CN",
"latitude": 39.988518,
"longitude": 116.478797,
"sdkVersion": "3.3.6",
}

输入框改变内容事件(VIEW_CHANGE)

  • 请求发送时机:当用户对App上的输入元素有改变的行为时
  • 请求Body
字段名称数据类型是否必有解释说明
pathstring元素所属页面名
pageShowTimestamplong页面显示时间
textValuestring元素文本内容
xpathstringxpath标识符
indexint列表元素序号
hyperlinkstringHybrid页面元素的href
querystringHybrid页面url 中的query

示例

{
"deviceId": "7196f014-d7bc-4bd8-b920-757cb2375ff6",
"userId": "张三",
"sessionId": "d5cbcf77-b38b-4223-954f-c6a2fdc0c098",
"eventType": "VIEW_CHANGE",
"timestamp": 1506069592985,
"domain": "com.growingio.app",
"urlScheme": "growing.756c39fb86f318cc",
"appState": "FOREGROUND",
"globalSequenceId": 99,
"eventSequenceId": 3,
"path": "/NestedFragmentActivity/GreenFragment[fragment1]",
"pageShowTimestamp": 1506069592985,
"textValue": "张三",
"xpath": "/Page/LinearLayout[0]/FrameLayout[1]/EditText#loginName",
"networkState": "4G",
"appChannel": "应用宝",
"screenHeight": 1920,
"screenWidth": 1080,
"deviceBrand": "google",
"deviceModel": "Nexus 5",
"deviceType": "PHONE",
"platform": "Android",
"platformVersion": "7.1.2",
"appName": "看数小助手",
"appVersion": "1.2.4",
"language": "zh_CN",
"latitude": 39.988518,
"longitude": 116.478797,
"sdkVersion": "3.3.6",
}

网页、小程序表单提交事件(FORM_SUBMIT)

  • 请求发送时机:网页、小程序页面发生表单提交事件
  • 请求Body
字段名称数据类型是否必有解释说明
pathstring元素所属页面名
pageShowTimestamplong页面显示时间
xpathstringxpath标识符
indexint列表元素序号
querystringHybrid页面url 中的query

示例

{
"deviceId": "7196f014-d7bc-4bd8-b920-757cb2375ff6",
"userId": "张三",
"sessionId": "d5cbcf77-b38b-4223-954f-c6a2fdc0c098",
"eventType": "FORM_SUBMIT",
"timestamp": 1506069592985,
"domain": "www.growingio.com",
"urlScheme": "growing.756c39fb86f318cc",
"appState": "FOREGROUND",
"globalSequenceId": 99,
"eventSequenceId": 3,
"path": "/",
"pageShowTimestamp": 1506069592985,
"xpath": "/div.align-items-start.d-flex.flex-column.justify-content-between.scaffold/div.align-items-start.d-flex.flex-fill.flex-row.justify-content-start/div.full/div/form",
"networkState": "4G",
"appChannel": "应用宝",
"screenHeight": 1920,
"screenWidth": 1080,
"deviceBrand": "google",
"deviceModel": "Nexus 5",
"deviceType": "PHONE",
"platform": "Android",
"platformVersion": "7.1.2",
"appName": "看数小助手",
"appVersion": "1.2.4",
"language": "zh_CN",
"latitude": 39.988518,
"longitude": 116.478797,
"sdkVersion": "3.3.6",
}

激活事件(ACTIVATE)

  • 请求发送时机:当 App 首次激活打开时
  • 请求Body
字段名称数据类型是否必有解释说明
attributesMap<string, string>激活相关属性
imeistringIMEI(Android 特有)
androidIdstringAndroidId(Android 特有)
oaidstring国内的广告ID(Android 特有)
googleAdvertisingIdstringgoogle广告ID(Android 特有)
idfastringiOS广告标识符(iOS 特有)
idfvstringiOS应用开发商标识符(iOS 特有)

示例

{
"deviceId": "7196f014-d7bc-4bd8-b920-757cb2375ff6",
"userId": "张三",
"sessionId": "d5cbcf77-b38b-4223-954f-c6a2fdc0c098",
"eventType": "ACTIVATE",
"timestamp": 1506069592985,
"domain": "com.growingio.app",
"urlScheme": "growing.756c39fb86f318cc",
"appState": "FOREGROUND",
"globalSequenceId": 2,
"eventSequenceId": 1,
"networkState": "4G",
"appChannel": "应用宝",
"screenHeight": 1920,
"screenWidth": 1080,
"deviceBrand": "google",
"deviceModel": "Nexus 5",
"deviceType": "PHONE",
"platform": "Android",
"platformVersion": "7.1.2",
"appName": "看数小助手",
"appVersion": "1.2.4",
"language": "zh_CN",
"latitude": 39.988518,
"longitude": 116.478797,
"oaid": "eeefbf75-3df7-15e0-ffb5-ff1ff09f1ec3",
"sdkVersion": "3.4.3",
"attributes": {
"userAgent": "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.65 Mobile Safari/537.36"
}
}